package com.zg.autoflow.web;

import com.zg.autoflow.req.AutoflowExtendsAddReq;
import com.zg.autoflow.service.AutoflowExtendsService;
import com.zg.common.core.R;
import com.zg.common.core.dao.autoflow.entity.AutoflowExtends;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
* @author zg
*/
@RestController
@RequiredArgsConstructor
@Api(tags = {"继承配置"})
public class AutoflowExtendsController {

	private final AutoflowExtendsService autoflowExtendsService;
	@ApiOperation("新增继承")
	@PostMapping("/autoFlow/extends/add")
	public R<?> add(@RequestBody @Valid AutoflowExtendsAddReq param) {
		AutoflowExtends obj = autoflowExtendsService.add(param);
		return R.success(obj);
	}

	@ApiOperation("删除继承")
	@PostMapping("/autoflow/extends/del")
	public R<?> del(@RequestBody List<Long> idList) {
		autoflowExtendsService.del(idList);
		return R.success();
	}
}
